package edu.udlap.spring2008.is300.finalexam.app.mvc.model.database.filters;

import edu.udlap.spring2008.is300.finalexam.framework.mvc.model.database.filters.ImageRecordFilter;
import edu.udlap.spring2008.is300.finalexam.framework.mvc.model.database.filters.ImageRecordFilterDecorator;
import edu.udlap.spring2008.is300.finalexam.framework.mvc.model.database.objects.FormatRecord;

/**
 *
 * @author Ruslán Ledesma Garza
 */
public class AppImageRecordFilterFormat extends ImageRecordFilterDecorator
{
    
    public AppImageRecordFilterFormat(ImageRecordFilter imageRecordFilter,
            FormatRecord formatRecord, boolean isNegated)
    {
        decoratedImageRecordFilter_ = imageRecordFilter;
        filterValue_ = formatRecord;
        isNegated_ = isNegated;
    }

    @Override
    protected String getSqlConstraints_()
    {
        return "\"ID_FORMAT\" " + (isNegated_ ? "!" : "") +
                "= " + ((FormatRecord)filterValue_).getId();
    }

}